package popcorn.ticket.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import popcorn.ticket.entity.MovieReview;
import popcorn.ticket.entity.MovieReviewExample;


@Repository
public interface MovieReviewMapper {
	long countByExample(MovieReviewExample example);

	int deleteByExample(MovieReviewExample example);

	int deleteByPrimaryKey(Integer reviewid);

	int insert(MovieReview record);

	int insertSelective(MovieReview record);

	List<MovieReview> selectByExample(MovieReviewExample example);

	MovieReview selectByPrimaryKey(Integer reviewid);

	int updateByExampleSelective(@Param("record") MovieReview record, @Param("example") MovieReviewExample example);

	int updateByExample(@Param("record") MovieReview record, @Param("example") MovieReviewExample example);

	int updateByPrimaryKeySelective(MovieReview record);

	int updateByPrimaryKey(MovieReview record);

	/**
	 * 根据电影名称模糊查询加分页+时间区间
	 * 
	 * @param keywords
	 * @return
	 */
	List<MovieReview> getMovieReviewByLike(@Param("keywords") String keywords, @Param("username") String username,
			@Param("moviename") String moviename, @Param("startTime") String startTime,@Param("userid") int userid,
			@Param("endTime") String endTime);


	/**
	 * 批量修改显示状态
	 * 
	 * @param idList
	 * @return
	 */
	int UpdateMRSta(List idList);
	
	/**
	 * 根据影评编号获取追评内容
	 * @param commentid
	 * @return
	 */
	MovieReview getMovieReviewByCommentid(int commentid);
	
	/**
	 * 查询某个评论下的追评
	 * @param commnetid
	 * @return
	 */
	List<MovieReview> getMVByCommentId(int commentid);


}